/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Observer4;

/**
 *
 * @author Marcel
 */
public class Main {

    public static void main(String[] args) {

        ConcreteSubject s = new ConcreteSubject();

        Observer o1 = new ConcreteObserver(s);
        Observer o2 = new ConcreteObserver(s);
        Observer o3 = new ConcreteObserver(s);
        Observer o4 = new ConcreteObserver(s);
        Observer o5 = new ConcreteObserver(s);
        Observer o6 = new ConcreteObserver(s);


        s.add(o1);
        s.add(o2);
        s.add(o3);
        s.add(o4);
        s.add(o5);
        s.add(o6);

        s.setState("A");
        
        s.remove(o6);
        s.remove(o5);
        s.setState("B");
    }
}
